<template>
  <div>
    <el-dialog
      append-to-body
      :title="title || '弹窗操作'"
      :width="width || '50%'"
      :height="height || '60%'"
      top="'50px' "
      :visible="show" @close="windowClose">

      <div v-if="type === 'HTML'">
        <p v-html="value" style="white-space: pre-wrap;">

        </p>
      </div>

      <div v-if="type === 'JSON'">
          <!--      todo 根据各种类型的展示页面 -->
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "open-dialog",
  data() {
    return {
      show: false,
      title: "弹层提示",
      width: "50%",
      height: "60%",
      type: "HTML",
      value: {}
    }
  },
  methods: {
    windowClose() {
      this.show = false;
    }
  }
}
</script>

<style scoped>

</style>
